//
//  WYCArgeeViewController.m
//  掌上还
//
//  Created by 王晓民 on 2018/1/19.
//  Copyright © 2018年 中企互联. All rights reserved.
//

#import "WYCArgeeViewController.h"

@interface WYCArgeeViewController ()<UIWebViewDelegate>
@property (nonatomic,strong)UIWebView *agreeWebView;

@end

@implementation WYCArgeeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //导航
    [self setupNav];
    self.view.backgroundColor = [UIColor whiteColor];
//    if ([_flag isEqualToString:@"333"]) {
//        NSLog(@"注册进来的");
        UIView  *addNav = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 64)];
        addNav.backgroundColor = WYCMain;
        addNav.userInteractionEnabled = YES;
        [self.view addSubview:addNav];
    
        //返回按钮
        UIButton *  backbutton = [[UIButton alloc] init];
        [backbutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
        [backbutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
        backbutton.frame = CGRectMake(40 * px, 25, 40 , 40);
        [addNav addSubview:backbutton];
    
        _agreeWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64)];


    NSString *path = [[NSBundle mainBundle] pathForResource:@"xieyi" ofType:@"html"];
    NSURL* url = [NSURL  fileURLWithPath:path];//创建URL
    NSURLRequest* request = [NSURLRequest requestWithURL:url];//创建NSURLRequest
    [_agreeWebView loadRequest:request];//加载
    
    [self.view addSubview:_agreeWebView];
    
    
}
-(void)backClick
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
//Nav字体颜色+ 背景
- (void)setupNav {
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self.navigationController.navigationBar setBarTintColor:WYCMain];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
